<!--  -->
<template>
    <div>
        <ul class="table w1021">
            <li class="tableTr" :class="index % 2 == 0 ? 'odd' : 'even'" v-for="(item, index) in data" :key="index">
                <div class="tableTd fl" @click="newDetail(list)" v-for="(list, index) in item" :key="index">
                    <span class="tableSign" :class="list._color" v-if="status">
                        {{ list._negaPosiMark }}
                    </span>
                    <span class="tableTitle">{{ list._title.substring(0, 26) }}</span>
                    <span class="tableTime fr">{{ list.publDate }}</span>
                </div>
            </li>
            <div class="tableNone orange w1021" v-if="data.length == 0">暂无数据</div>
            <div class="page w1021" v-if="total && data.length != 0">
                <span>注：点击标题名称可查看全文</span>
                <el-pagination
                    small
                    layout="prev, pager, next"
                    :page-size="10"
                    :total="total"
                    :current-page="currentPage"
                    @current-change="changePage"
                ></el-pagination>
            </div>
        </ul>
    </div>
</template>

<script>

import {BASE_URL} from "@/common/const";
import {openWeb} from "@/common/common";

export default {
    data() {
        return {
            currentPage: 1,
        };
    },
    props: ["title", "data", "total", "infoType","status"],
    methods: {
        changePage(page) {
            this.$emit("page", {page, infoType: this.infoType});
        },
        newDetail(ops) {

            console.log("ops",this.infoType,ops)


            let type = this.infoType == 2 ? 4: 1;
            let newId = ops.guid ? ops.guid : (ops.seq || ops.objectId);
            let stockId = ops.stockId || '';
            let kcType = ops.kcType || '';

            const url = this.urlAbsolute(`/newDetail/index.html?newId=${newId}&stockId=${stockId}&kcType=${kcType}&type=${type}`);
            openWeb(url, this.title, 1)
        }
    }
};
</script>
<style lang="scss" scoped></style>
